package com;
import java.io.*;
public class Writer {
    public static void main(String[] args) throws Exception {
        File file = new File("D:" + File.separator + "baidu" + File.separator + "www.baidu.txt");
        if (!file.getParentFile().exists()) {
            file.getParentFile().mkdirs();
        }
        try (FileWriter out = new FileWriter(file)){
            out.write("www.baidu.com\n");
            out.append("百度网页：https://www.baidu.com");
        }catch (Exception e){}
    }
}
